Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development


Checking session types and session parameters

Each Progress Dynamics session is started up based on a session type. The session type is the one parameter normally passed in to the startup command using the ICFSESSTYPE parameter of the icfstartup Progress startup option, as shown:

In this example, the ICFSESSTYPE used at startup, which is really a logical session type that can have a number of properties of its own, is ICFDEV. Look at the session types to see that the physical session type for ICFDEV is GUI, as shown:

Use the getPhysicalSessionType function to query the physical session type, as shown:

CType = DYNAMIC-FUNCTION(‘getPhysicalSessionType’). 

These are the possible physical types:

You can also access the values of any of the session properties, or even define new properties of your own, using the getSessionParam and setSessionParam functions, as shown:

cParamValue = DYNAMIC-FUNCTION(‘getSessionParam’, pcParam). 

lResult = DYNAMIC-FUNCTION(‘setSessionParam’, pcParam, pcValue). 

Here is an example of using these. If you set a parameter that was not defined before, it is defined for you and you can retrieve its value later, as shown in the following example:

/* testSessionParam.p -- tests get/setSessionParam and  
       getPhysicalSessionType in the Configuration File Manager). */ 
    DEFINE VARIABLE cSessType AS CHARACTER  NO-UNDO. 
    DEFINE VARIABLE cLocal    AS CHARACTER  NO-UNDO. 
    DEFINE VARIABLE cFoobar   AS CHARACTER  NO-UNDO. 
    DEFINE VARIABLE cPhysical AS CHARACTER  NO-UNDO. 
    cSessType = DYNAMIC-FUNCTION('getsessionparam','icfsesstype'). 
    cLocal = DYNAMIC-FUNCTION('getsessionparam','run_local'). 
    DYNAMIC-FUNCTION('setsessionparam','foobar','yes-indeed'). 
    cFoobar = DYNAMIC-FUNCTION('getsessionparam','foobar'). 
    cPhysical = DYNAMIC-FUNCTION('getphysicalsessiontype'). 
    MESSAGE "ICFSessType is  " cSessType SKIP 
            "Run_local is    " cLocal    SKIP 
            "New Foobar is   " cFoobar   SKIP 
            "Physical Type is" cPhysical. 

Running this code results in the following Message window:

For more information about other API calls, see the Configuration File Manager section in OpenEdge Development: Progress Dynamics Managers API Reference .


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095